package com.axjc.gqzr.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Builder;
import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import java.util.List;

/**
 * 用户表
 * @TableName sys_user
 */
@TableName(value ="sys_user")
@Data
public class SysUser implements Serializable, UserDetails {
    /**
     * 用户ID
     */
    @TableId(value = "user_id")
    private Long user_id;

    /**
     * 用户名
     */
    @TableField(value = "username")
    private String username;

    /**
     * 密码
     */
    @TableField(value = "password")
    private String password;

    /**
     * 盐值
     */
    @TableField(value = "salt")
    private String salt;

    /**
     * 电话号码
     */
    @TableField(value = "phone")
    private String phone;

    /**
     * 头像
     */
    @TableField(value = "avatar")
    private String avatar;

    /**
     * 昵称
     */
    @TableField(value = "nickname")
    private String nickname;

    /**
     * 姓名
     */
    @TableField(value = "name")
    private String name;

    /**
     * 邮箱地址
     */
    @TableField(value = "email")
    private String email;

    /**
     * 所属部门ID
     */
    @TableField(value = "dept_id")
    private Long dept_id;

    /**
     * 创建人
     */
    @TableField(value = "create_by")
    private String create_by;

    /**
     * 修改人
     */
    @TableField(value = "update_by")
    private String update_by;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private Date create_time;

    /**
     * 修改时间
     */
    @TableField(value = "update_time")
    private Date update_time;

    /**
     * 锁定标记，0未锁定，9已锁定
     */
    @TableField(value = "lock_flag")
    private String lock_flag;

    /**
     * 删除标记，0未删除，1已删除
     */
    @TableField(value = "del_flag")
    private String del_flag;

    /**
     * 微信登录openId
     */
    @TableField(value = "wx_openid")
    private String wx_openid;

    /**
     * 小程序openId
     */
    @TableField(value = "mini_openid")
    private String mini_openid;

    /**
     * QQ openId
     */
    @TableField(value = "qq_openid")
    private String qq_openid;

    /**
     * 码云标识
     */
    @TableField(value = "gitee_login")
    private String gitee_login;

    /**
     * 开源中国标识
     */
    @TableField(value = "osc_id")
    private String osc_id;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return List.of();
    }
}